<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Laravel\Scout\Searchable;

class Article extends Model
{
    use Searchable;
    protected $table = 'articles';
    protected $guarded = ['id', 'created_at', 'updated_at'];
    public $timestamps = true;

    protected $appends = ['test'];

    public function getTestAttribute()
    {
        return '我是Test!';
    }

    public function toSearchableArray()
    {
        return $this->only('id', 'title', 'content', 'test');
    }


}
